package client_cmd;

import java.io.IOException;

import connet_sever.ConnectServer;
import client_entity.User;

public class Login_Cmd extends Command{
	
	private static final int LOGIN = 1;
	
	public Login_Cmd(User u)
	{
		super(u);
	}
	
	//请求登录的命令
	public boolean request_login()
	{
		if(connector==null)
			return false;
		else{
			try {
				connector.send(LOGIN, user);
			} catch (IOException e) {
				e.printStackTrace();
				return false;
			}
			user = (User) connector.recieve();
			if(user!=null)
				return true;
			else
				return false;
		}
	}
	

	
	
}
